package com.learn.egcar1.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;

@Data
public class UserRegParam {
    //全局异常处理器中：String data = ex.getFieldError().getDefaultMessage();结果：用户名不能为null
//    @NotNull(message = "用户名不能为null")
//    @NotEmpty(message = "用户名不能为null和空字符串")
//    @NotBlank(message = "用户不能为null和空字符串和空白串")
//    @Size(min = 1, max = 20, message = "用户名长度必须在1-20之间")
    @Pattern(regexp = "^[a-zA-Z0-9_-]{4,16}$", message = "用户名格式不正确")
    @ApiModelProperty(value = "用户名", required = true,dataType = "String")
    private String username;
    @ApiModelProperty(value = "密码", required = true,dataType = "String")
    private String password;
    @ApiModelProperty(value = "邮箱",required = true,dataType = "String")
    private String email;
    @ApiModelProperty(value = "手机号",required = true,dataType = "String")
    private String phone;
}
